<template>
	<view class="announce">
		<view>
			<u-tabs-swiper  :list="list" ref="tabs" :height="100" :is-scroll="false" :bold="false" :current="current" @change="tabsChange" active-color="#de4f38" :bar-width="80" :bar-height="6"></u-tabs-swiper >
		</view>
		<swiper :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish" class="swiper-box" >
			<swiper-item class="swiper-item">
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
					<view class="list" v-if="listData.length>0">
						<view class="item" v-for="(item,index) in listData" :key="index">
							<view class="u-flex item-bottom">
								<view class="u-flex u-row-between box">
									<view class="u-flex u-row-between">
										<view>
											<u-image
											class="image" 
											width="80rpx" 
											height="80rpx" 
											border-radius="80rpx"
											:src="item.url"></u-image>
										</view>
										<view class="item-info u-p-l-20">
											<view class="name u-m-b-20">{{item.name}}</view>
											<view class="txt">提交时间：{{item.time}}</view>
										</view>
									</view>
									<view class="item-info">
										<view class="name u-m-b-20">{{item.num}}</view>
										<view class="txt">{{item.des}}</view>
									</view>
								</view>
							</view>
							<view class="item-box u-m-t-30">
								<view class="item-box-image">
									<u-image
										class="image" 
										width="190rpx" 
										height="190rpx" 
										src="http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg"></u-image>
								</view>
								<view class="info">
									<view class="title u-font-lg u-m-b-15">
										YSL圣罗兰精彩底妆礼盒
										小金条21小粉条
									</view>
									<view class="con u-m-t-10">
										<view class="info-item u-flex  u-m-b-10">
											<u-image
												class="image" 
												width="40rpx" 
												height="40rpx" 
												src="/static/icons/brand_icon.png"></u-image>
												<view class="text u-font-sm">品牌名称:</view>
											<view class="num u-font-sm">轻十一设计</view>
										</view>
										<view class="info-item u-flex">
											<u-image
												class="image" 
												width="40rpx" 
												height="40rpx" 
												src="/static/icons/fans_icon.png"></u-image>
												<view class="text u-font-sm">粉丝要求:</view>
											<view class="num u-font-sm">100000<text class="u-font-xs">+</text></view>
										</view>
									</view>
								</view>
							</view>
							<!-- 按钮 -->
							<view class="u-flex u-row-between">
								<view>待审核</view>
								<view><u-button type="warning" shape="circle" size="medium" class="send" hover-class="none" :ripple="true">审核任务</u-button></view>
							</view>
						</view>
					</view>
				</scroll-view>
			</swiper-item>
			<swiper-item class="swiper-item">
				<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="onreachBottom">
					<view class="list" v-if="listData.length>0">
						<view class="item" v-for="(item,index) in listData" :key="index">
							<view class="u-flex item-bottom">
								<view class="u-flex u-row-between box">
									<view class="u-flex u-row-between">
										<view>
											<u-image
											class="image" 
											width="80rpx" 
											height="80rpx" 
											border-radius="80rpx"
											:src="item.url"></u-image>
										</view>
										<view class="item-info u-p-l-20">
											<view class="name u-m-b-20">{{item.name}}</view>
											<view class="txt">提交时间：{{item.time}}</view>
										</view>
									</view>
									<view class="item-info">
										<view class="name u-m-b-20">{{item.num}}</view>
										<view class="txt">{{item.des}}</view>
									</view>
								</view>
							</view>
							<view class="item-box u-m-t-30">
								<view class="item-box-image">
									<u-image
										class="image" 
										width="190rpx" 
										height="190rpx" 
										src="http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg"></u-image>
								</view>
								<view class="info">
									<view class="title u-font-lg u-m-b-15">
										YSL圣罗兰精彩底妆礼盒
										小金条21小粉条
									</view>
									<view class="con u-m-t-10">
										<view class="info-item u-flex  u-m-b-10">
											<u-image
												class="image" 
												width="40rpx" 
												height="40rpx" 
												src="/static/icons/brand_icon.png"></u-image>
												<view class="text u-font-sm">品牌名称:</view>
											<view class="num u-font-sm">轻十一设计</view>
										</view>
										<view class="info-item u-flex">
											<u-image
												class="image" 
												width="40rpx" 
												height="40rpx" 
												src="/static/icons/fans_icon.png"></u-image>
												<view class="text u-font-sm">粉丝要求:</view>
											<view class="num u-font-sm">100000<text class="u-font-xs">+</text></view>
										</view>
									</view>
								</view>
							</view>
							<!-- 按钮 -->
							<view class="u-flex u-row-between">
								<view>待审核</view>
								<view><u-button type="warning" shape="circle" size="medium" class="send" hover-class="none" :ripple="true">审核任务</u-button></view>
							</view>
						</view>
					</view>
				</scroll-view>
			</swiper-item>
			</swiper-item>
		</swiper>
		<u-toast ref="uToast" />
		<!-- 关于千晨 -->
	</view>
</template>

<script>
	import AnnounceList from '../components/announce-list/index.vue'
	export default {
		components: {
			AnnounceList
		},
		data() {
			return {
				avatarUrl:'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
				list: [{
					name: '我发布的'
				}, {
					name: '任务审核'
				}],
				current: 0,
				swiperCurrent: 0, 
				value: 0,
				listData:[{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:0,
				},{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:1,
				},{
					name:'抖音精品小淘',
					url: 'http://img3m3.ddimg.cn/69/34/1510438713-1_b_1.jpg',
					time:'2021-01-20 12:12:12',
					num:16836,
					des:'粉丝数',
					type:3,
				}],
			};
		},
		methods: {
			tabsChange(index) {
				this.swiperCurrent = index;
			},
			transition(e) {
				let dx = e.detail.dx;
				this.$refs.tabs.setDx(dx);
			},
			animationfinish(e) {
				let current = e.detail.current;
				this.$refs.tabs.setFinishCurrent(current);
				this.swiperCurrent = current;
				this.current = current;
			},
			onreachBottom() {
				
			}
		}
	};
</script>

<style lang="scss" scoped>
.announce {
	display: flex;
	flex-direction: column;
	height: calc(100vh - var(--window-top));
	.list{
		padding-top: 20rpx;
		.item{
			background-color: #fff;
			padding: 20rpx 30rpx;
			margin-bottom: 20rpx;
			.box{
				width: 100%;
				.item-info{
					.send{ padding: 0 20rpx;}
					.name{
						font-weight: 600;
						font-size: 32rpx;
					}
					.txt{
						color: #999999;
						font-size: 28rpx;
					}
				}
			}
			&-box{
				display: flex;
				background-color: #fff;
				border-radius: 10rpx;
				margin-bottom: 40rpx;
				.info{ 
					padding-left: 20rpx;
					width: 80%;
					.title{  
						display: flex; align-items: center; line-height: 45rpx; font-weight: 600;
						.u-font-lg{ padding-left: 20rpx; }
					}
					.con{ 
						.li{flex: 1; line-height: 30rpx; }
						.num{ color:#333; font-size: 30rpx; }
						.txt{ color:#666; font-size: 26rpx; }
					}
				 } 
			}
		}
	}
	
	.swiper-box {
		flex: 1;
		.swiper-item {
			height: 100%;
		}
	}
	.error{
		background-color: #CCCCCC;
		color: #fff;
	}
	.send{
		background-color: #de4f38;
		padding: 0 30rpx;
	}
	
	
}
</style>
